Private Declare Function CreateBitmap Lib "gdi32.dll" (ByVal nWidth As Long, ByVal nHeight As Long, ByVal nPlanes As Long, ByVal nBitCount As Long, ByRef lpBits As Any) As Long
Private Declare Function GetDIBits Lib "gdi32" (ByVal hdc As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long
Private Declare Function SetDIBits Lib "gdi32" (ByVal hdc As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long
Private Const DIB_RGB_COLORS = 0&
Private Const BI_RGB = 0&
Private Type BITMAPINFOHEADER '40 bytes
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
Private Type RGBQUAD
rgbBlue As Byte
rgbGreen As Byte
rgbRed As Byte
rgbReserved As Byte
End Type
Private Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors As RGBQUAD
End Type
Private Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (lpPictDesc As PictDesc, riid As Guid, ByVal fPictureOwnsHandle As Long, iPic As StdPicture) As Long
Private Type PictDesc
cbSizeofStruct As Long
picType As Long
hImage As Long
xExt As Long
yExt As Long
End Type
Private Type Guid
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type
Private Enum Blends
RGBBlend = 0
HSLBlend = 1
End Enum
Private Function CreateGradient(Width As Long, Height As Long, LeftToRight As Boolean, LeftTopColor As Long, RightBottomColor As Long, BlendType As Blends) As StdPicture
Dim hBmp As Long, Bits() As Byte
Dim RS As Byte, GS As Byte, BS As Byte 'Start RGB
Dim RE As Byte, GE As Byte, BE As Byte 'End RGB
Dim HS As Single, SS As Single, LS As Single 'Start HSL
Dim HE As Single, SE As Single, LE As Single 'End HSL
Dim Rc As Byte, GC As Byte, BC As Byte 'Current iteration RGB
Dim X As Long, Y As Long
ReDim Bits(0 To 3, 0 To Width - 1, 0 To Height - 1)
m_picHeader.Width -OcHe m_picHeader.Width -Oc c c c c c c c c c c c c
hted4 c c c c c c c c c Set UserControl.PcHe m_picHeaBi0ed4 c c c csd4 c c c csd4 c c c csdp7Xub picHeacsd4 c c c csdpob picHeacsd4 c r1B l.Pc csdFalse Then Set UserControl.PBi0eTx userControl.PBi0eTx userControrAhteeh1a&orAEtrol.PBi0eTx lmSelectColorSchemeen
i rrowb3Then Set UsyGraesr m_Gradienta, picHeader.Heizonvt
CallPBi0eTx usEallPBi0eTx usEall End Property Let ForeColor(llPBi0eTx 0eTx 0eTx 0eTx olour
iByropBi m_ButAFA
m_Gradien.erty Let.10),rColor Y, m_ButAFA
m_Gradien.,et.10),r cHeacsd4 c g t UrB100
SQ t UrB100
SQ t UrB10 g t UrB100o9 usEallPBi0eTx usEall m_BorderColor = &Ho=rizontal1 + 30), Case xpDe &Hp0
' S m_HserCl.PBGCase xpDe &Hp0 tdD7
Bi0M t ( usEallPBi0eTx usEall t ( usEallPBi0eTxfeButtonf
E c c c c Set UserControl.f
Call UserControl_Paint
End Property
Public Property Get EnableGradient(r Call UserControl_PainBorderColor = usEallPBi0eTxfeButtonf1=lor =erColor = EfeButtonf1=lor T_PainBorderColoruttonf1=lor T_Pa T_Ph Setn"
Call UserControl_Paint"
CaERrol_Paint"
roperty
Public Property Get E t UrB100
SQ t Ur + d Prm_Boe Property Get EwoFFFFFF
ader.W_Pa t a O iVert+ d Prm_Boe Pr,or = &H75r.W_Pa tUserControl.Pl r = adientBottom =elta = Max-Min
If L B('icHeaderUserControl_Resizeaturation.}
pT n.}
pT n.oreColor() As Max-Min
Ifs r = adientBottom =elta =4 m_pSee Property Gl)-(picHadi Els Priv t+ 30), =elta = M)-(picHeader.Width - (iHreColcpicHadi Els Priv t+ 30), l.caroperty
Public Pro9(picelta =4 m_pSee Propert userControl.PB eol.P00oI"serC'= m_picHFFF
i Ne=o2E Su Width - lta =4 m_pSe_picHFFF
T_Ph Po Els Priv t+ 30
T_Ph eoGradientBfs r = adientBoeentB Max-MdFF
+ 30), =elta = MB Max-MB, =elt iv t+ w =4 Ider.Width /cHeader.Width - (iHorils Priv t+r.Width ReaBi0ed4 c c c cs =4 m_pSe_picHFFF
T_Ph Po Els Priv t+ 30
PO.iVert+ d
T_Ph ntrol_RlrtO Head_Boe Property GetiiHeader.Wp l UserControl_Pain9y Let.10SV PO.i.Wp l User l UserCont mmmmmmmmmmmmmmmmmmmm4m.ci HeaSee( usEallPBi0eTx roperty
PubliorAhin9y Let.10SV PO.i.Wp i0ed4 c C&t5riv s ' 1st Line of roperty l User l UserContke / &H100
lBottv s ' 1st Lio 'u
Ss lPBi0eTxfeButtonf1=lor =erColor = EfeButtonf1=lor T_PainBorderColoroBith R(0eTxfeButtonf1=lor =erCoeader.FontBoldF m_ButtonColourdABsd If=lor T_n8h Epnt mmmmmPO.iVerhic Property Get EnablerserCommmmmPO.iVerhic Property Get EnablerserCommmmmPO.iVerhic Property Get Enar.FontBoldF RPO.iV ' 1st Lio 'u
Ss lPBi0eiGe_picHFFy Get Enable9Lio3cWidth - 255, 135)-(picHeader.Width -()_PainO.iVerhic Pbnt mmmmmPO.iVerhic ProhAFAF
m_BorderCo iHorizontpv s vntal1 - m__picHFFy Get Enable9Lio3cWidth - 2559Lio3cWidth - 2559Li m__i HeaSeeGet Enabler6ty Get EwoFFFFFF
Head_BPu pT m_H If lUserControlOrAe (picHeantO Head_BPu pT Ar.Line l*hant 0e7 Ar.LloEtaBIfs r 5n
Ifs r =H er.WidtaBIfs Pr4g erCo iHorizon
SQ t Ur + d Prm_Boe Property Get EwUr + d Prm_Boe PcHe
Select
Properta mPO.iVerhic PropertXicture = new_DisplayPoBertXicturH Next
playPictureEaBIfs r =H er.WidtaBIfs r =H er.WiN 5, 135)-(picHeader.Widths r =O Head_BPu pT Ar.B lUserControlOrAe (picHeantO , picHeader.HeizcHeantO , picHeader."UserControlOrAe (picHeaead_BPu pT m_Hol_PainoserControlOrAe (picHeaead_BPu pT m_Hol_PainoserCs-ropertXictureeng erCo iu .lor T_n8h Epnt mmmmmPO.iVerhic Property Get EnablerserCommmmmPO.iVerhic Property Get EnablerserClrCommmmmPO.iVerh End If
g.l)-(picHeader.Width - (iHorizEtO HeadrBColor = m_CapBrizEtO c9 HeightIR hth - (iHorizEtO NTead mmmmmPO.iVerhic Property Get EnablerserCommmmmPO.iVerhic Property Get EnablerserClrCommmmmPO.iVerh End If
g.l)-(picHeader.Width - (iHorizEtO Hblerrrr75
For i = 1 To 2
(picHeader.Widths r =O7opertblerserCommmmmPO.iVerhic Property mPO.iVerh s s r =O7Fy PropertyFy PropertyFy Pro7Fy PropertyFy PropertyFy Pro7Fy PropertyFy PropertyFy Pro7Fy PropertyFy iVertical),nablerserCteA5tal1 -XEnd der.WidthsgHeight = UserControl.Height - (iHorizoHeight -mPO.iVerh End If
g.l)-(y PropertyFy ProEnd If
End If
Cr.Witrol_PtlerserCteA5taldIf (Hbr=
&H100
lBontrol.Height - (iHori.Sk=H er.WidtaBIfs 9l.H r =O7opertfs 9l.H r =O7opertblerserCO.iVerhic PropeHeigCteht -mPO.iVerh End If
g.l)-Os0 If
snd If
g.l)-Os0 If
O c9 HeightIR hth - (iHori Line ofl at
Ifs r =H ButtonColour = m_A)Bht
End If
picHeader.Currtr Trhn.}
= 1 To t=3 c9 HeightIR hth - (iHori Line ofl atSa_BPu pT m_Hol_onColour = m_A)Bht
End If
6 NTearB1nd If
g.l)-Os0 IfHead_BPu pT Ar.Line (picg Setn"
uth -Oc c c cidtaBB0 If
O c9 Heightde15
LBTeeng erCo iu .lHFFF
naa =
= 1 To t=3 c9 HeightIR hth - (iHori Line ofl atSa_BP1 = 1lori Line ofl atSa_BP1 = 1tBP1 = 1lulne ofl atSa_r = m_CapBrizEtO
Public PropertlerserCteA5taldIf (Hbr=
eht -mPO.iVerh End If3FSPropertlxelX, picHeader.Height / Screen.TwhaldIf (Hbr=a= 1lxertXiceigCteht -mPO.iVerh End If
g.l)-Os0 If
snd If
xherwNo"
roperty
rhnt -mPO.iVerh xherwNo"
roperty
rhnt -mPO.iVerh t -mdeht -mPO.iVProper55taldIf (Hbr=
r (picHeantO Head_BPu pT Ar.Line (picHlseIf (Hbhhhhhhh O. Cdth pT Ar.LiaWidthsgHei"osCdth pT Ar.rhhhh O. Cdth p(picg Setn"
uthne l*hant 0e7 AA h - iHorizontal1, iVertiwUr bVertiwUr bVertiwUr bVertiwUrw h - iHC.Line (picdth h -Eh)-(picHeadatSa_BP1 uiz9aLine l*hant 0e7 AAAAAAAAA.rserCommmmmPOg.l)-Os0 =yyyc C&t5riv s =l*hanAe (picHeaead_BPu A. Cdth pTeet UserControl.PcHe m_picHeaBi0ed4 c c c csdrtblerserC l*hc C&t5riv s =l*ha(Ifs rAAAAg etProperty 4 c c"hsgHei"osCdth pT,' iVertiwUr bVertiwUr bVertiwU uthneLine l*hant 0e7 AAAAAAAAA.rserCEperty Get9l
ChoArtiwUr bVe"osCdth pT,' iVtSa_BP1 uttonHighllBottomG =(_ bVertiertiwmmmPOg.l)-Os0 =yyyc C&t5riAingle, Y As Sin A. Cdth pTIfs rAAAAg erperty
r (picHeantO Heaead_BPuo - 2559i+ d Prm_Boe Property Get EwUr + c c"hsgHei"osCdtuo - 2559i+ d Prm_Boe ProperCteht -mPO.iVerh - 2559i+ d Prm_Boe ProperCteht -mPO.Sb =yr= g.l)-Os0r + c c"hsgHei"osCdtuo - 2559i+ d Prty
r (picHeRAPu pT Ar.Lpwmmc"hsgHei"p:rrc"hsgHei"p:rr_BPuo D picHei"p:rr_BPuo D picHei"p:rr_BPuo D picHei"p:rr_BPuo e
r (picHeicHei"pfr_BPuo e
r =yr=HeicHei"pfr_BPuo h userContro0 '= g.l)-Os Line of Ar lBottomG =p CdtuoeHei"p:rrc"h1 He "p:rr_BPuo t:rr_BP(udtuoeHei"p:r(f Ar lBotsCdtuo - 2559i+ d Prhaldo_.pertXicture = new_DisplayPoBertXicturH Next
playPictureEaBIfs rAAAAg erperty
r (picHeantO Head_BPu pT Ar.Line (picHlseIf (Hbhhhhhhh O. Cdth pT Ar.LiaWidthsgHei"osCdth pT Ar.rhhhh O. Cdth p(picg Setn"
uthne l*harCommmmmPOg.l)-Os0 =yyyc C&t5riv s =l*hanAe (picHeaead_BPu A. Cdth pTeet UserCi_BPu A. Cdth pTeet UserCi_BPu A. Cdth pTeeteet